package tetris;

import java.util.Comparator;

class CompareScores implements Comparator<Score> {
	
	/**
	 * Compares two results.
	 * @param first first result.
	 * @param second result.
	 * @return -1 when first result is higher than second and +1 when second result is higher than first.
	 */
	public int compare( Score first, Score second ) {
		int firstScore = first.getScore();
		int secondScore = second.getScore();

		if ( firstScore > secondScore ) {
			return -1;
		}
		else if ( firstScore < secondScore ) {
			return +1;
		}
		else {
			return 0;
		}
	}
}
